﻿<!--*************************************************************************************

   Toolkit for WPF

   Copyright (C) 2007-2016 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  ***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Text.Views.WatermarkTextboxView"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
                xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                Title="WatermarkTextBox">
   <local:DemoView.Description>
      <Paragraph FontSize="14"
                 FontFamily="Segoe">
         The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text.
      </Paragraph>
   </local:DemoView.Description>

   <StackPanel>
      <GroupBox Header="Features">
         <Grid Margin="5">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" />
               <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0"
                       Text="KeepWatermarkOnGotFocus: "
                       VerticalAlignment="Center" />
            <CheckBox Grid.Column="1"
                      x:Name="_keepWatermarkOnGotFocus"
                      IsChecked="False"
                      VerticalAlignment="Center" />
         </Grid>
      </GroupBox>

      <StackPanel>
         <TextBlock Text="Usage:"
                    Style="{StaticResource Header}" />

         <StackPanel Margin="10">
            <TextBlock Text="Default:"
                       Style="{StaticResource Header}" />
            <xctk:WatermarkTextBox Margin="5"
                                   MinWidth="200"
                                   Watermark="Enter Text"
                                   KeepWatermarkOnGotFocus="{Binding IsChecked, ElementName=_keepWatermarkOnGotFocus}"/>

            <TextBlock Text="Image Watermark:"
                       Style="{StaticResource Header}" />
            <xctk:WatermarkTextBox Margin="5"
                                   KeepWatermarkOnGotFocus="{Binding IsChecked, ElementName=_keepWatermarkOnGotFocus}">
               <xctk:WatermarkTextBox.Watermark>
                  <StackPanel Orientation="Horizontal">
                     <Image Source="..\Resources\PencilTool16.png"
                            Stretch="None" />
                     <TextBlock Text="Enter Text"
                                Margin="4,0,0,0" />
                  </StackPanel>
               </xctk:WatermarkTextBox.Watermark>
            </xctk:WatermarkTextBox>

            <TextBlock Text="Custom WatermarkTemplate:"
                       Style="{StaticResource Header}" />
            <xctk:WatermarkTextBox Margin="5"
                                   Watermark="Enter Text"
                                   KeepWatermarkOnGotFocus="{Binding IsChecked, ElementName=_keepWatermarkOnGotFocus}">
               <xctk:WatermarkTextBox.WatermarkTemplate>
                  <DataTemplate>
                     <Border BorderBrush="Green"
                             BorderThickness="1"
                             Padding="5">
                        <ContentControl Content="{Binding}"
                                        Foreground="DarkRed"
                                        FontWeight="Bold"
                                        Focusable="False" />
                     </Border>
                  </DataTemplate>
               </xctk:WatermarkTextBox.WatermarkTemplate>
            </xctk:WatermarkTextBox>
         </StackPanel>
      </StackPanel>
   </StackPanel>

</local:DemoView>
